As is known, a conventional computing system includes a central processing unit, a chip set, system memory, a video graphics processor, and a display. The video graphics processor includes a raster engine and a frame buffer. The system or main memory includes geometric software and texture maps for processing video graphics data. The display may be a cathode ray tube (CRT) display, a liquid crystal display (LCD) or any other type of display. A typical prior art computing system of the type described above is illustrated in FIG. 1. As shown in FIG. 1, the system 100 includes a host 102 coupled to a graphics processor (or graphics processing circuit) 104 and main memory 108. The graphics processor 104 is coupled to local memory 110 and a display 106. The host 102 is responsible for the overall operation of the system 100. In particular, the host 102 provides, on a frame by frame basis, video graphics data to the display 106 for display to a user of the system 100. The graphics processor 104, which comprises the raster engine and frame buffer, assists the host 102 in processing the video graphics data. In a typical system, the graphics processor 104 processes three-dimensional (3D) processed pixels with host-created pixels in the local memory 110 of the graphics processor 104, and provides the combined result to the display 106.
To process video graphics data, particularly 3D graphics, the central processing unit executes video graphics or geometric software to produce geometric primitives, which are often triangles. A plurality of triangles is used to generate an object for display. Each triangle is defined by a set of vertices, where each vertex is described by a set of attributes. The attributes for each vertex can include spatial coordinates, texture coordinates, color data, specular color data or other data as known in the art. Upon receiving a geometric primitive, a transform and lighting engine (or vertex shader engine) of the video graphics processor may convert the data from 3D to projected two-dimensional (2D) coordinates and apply coloring and texture coordinate computations to the vertex data. Thereafter, the raster engine of the video graphics processor generates pixel data based on the attributes for one or more of the vertices of the primitive. The generation of pixel data may include, for example, texture mapping operations performed based on stored textures and texture coordinate data for each of the vertices of the primitive. The pixel data generated is blended with the current contents of the frame buffer such that the contribution of the primitive being rendered is included in the display frame. Once the raster engine has generated pixel data for an entire frame, or field, the pixel data is retrieved from the frame buffer and provided to the display.
As known in the art the concept of a state is a way of defining a related group of graphics primitives; that is, a set of primitives having a common attribute or need for a particular type of processing define a single state. For example, if an object to be rendered on a display comprises multiple types of textures, graphics primitives corresponding to each type of texture comprise a separate state. A given state may be realized through state data. For example, the DirectX 8.0 standard promulgated by Microsoft Corporation defines the functionality for so-called programmable vertex shaders (PVSs). A PVS is essentially a generic video graphics processing platform, the operation of which is defined at any moment according to state data.
Generally, in the context of programmable vertex shaders, state data may comprise either code data or constant data. Code state data generally comprises instructions to be executed by the programmable vertex shader when processing the vertices for a given set of primitives. Constant state data, on the other hand, comprises values used by the programmable vertex shader when processing the vertices for the given set of primitives. Regardless of these differences, both code state data and constant state data share the common characteristic that they remain unchanged during the processing of vertices within a given state.
The DirectX standard sets forth sizes for the memory or buffers used to store the code state data and constant state data. In particular, according to the DirectX standard, the code buffer comprises 128 words, whereas the constant buffer comprises 96 words. However, in a preferred embodiment, the constant buffer comprises 192 words. Regardless, each word in the code and constant buffers comprise 128 bits. Typically, however, a given state will not occupy the entire available buffer space in either the code buffer or constant buffer. Additionally, frequent changes in state require frequent updates of the state data stored in the code and constant buffers, thereby leading to delays when performing such updates. One way to mitigate these delays is to provide duplicate code and constant buffers such that, while one set of buffers is being used to process graphics primitives, state data may be loaded in parallel into the duplicate set of buffers. However, this solution obviously doubles the cost of the buffers despite the fact that a given set of state data typically fails to occupy the entire buffer in which it is stored. Thus, it would be advantageous to provide a technique that substantially reduces delays caused by updating of state data but that does not require the use of additional memory. In particular, such a technique should exploit the frequent availability of otherwise unused state data buffer space.